import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Manage from '../views/Manage.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/manage',
    name: 'Manage',
    component: () => import('../views/Manage.vue'),
    children: [
      {
        path: 'first',name: 'First',component: () => import('../views/First.vue'),
      },
      {
        path: 'user',name: 'User',component: () => import('../views/User.vue'),
      },
      {
        path: 'person',name: 'Person',component: () => import('../views/Person.vue'),
      },
      {
        path: 'pet',name: 'Pet',component: () => import('../views/Pet.vue'),
      },
      {
        path: 'adoption',name: 'adoption',component: () => import('../views/Adoption.vue'),
      },
      {
        path: 'adorecord',name: 'adorecord',component: () => import('../views/AdoRecord.vue'),
      },
      {
        path: 'pethouse',name: 'pethouse',component: () => import('../views/PetHouse.vue'),
      },
      {
        path: 'noticeboard',name: 'noticeboard',component: () => import('../views/NoticeBoard.vue'),
      },
      {
        path: 'pwdchange',name: 'pwdchange',component: () => import('../views/pwdchange.vue'),
      },
      {
        path: 'notice',name: 'notice',component: () => import('../views/Notice.vue'),
      },
    ]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
